<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>用PHP扩展做一个HelloWorld！ - 科学家 - 博客园</title>
<link type="text/css" rel="stylesheet" href="/bundles/blog-common.css?v=VDh8zSH1vx51MDqRT7hK220akQ58FjlaaeGuWBPhfOA1"/>
<link id="MainCss" type="text/css" rel="stylesheet" href="/skins/nature/bundle-nature.css?v=SMSmqROZamyrz003uRLsZZQqisVE_ymEDyPy07GKHPw1"/>
<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/smcz/rss"/>
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/smcz/rsd.xml"/>
<link type="application/wlwmanifest+xml" rel="wlwmanifest" href="http://www.cnblogs.com/smcz/wlwmanifest.xml"/>
<script src="http://common.cnblogs.com/script/jquery.js" type="text/javascript"></script>  
<script type="text/javascript">var currentBlogApp = 'smcz', cb_enable_mathjax=false;</script>
<script src="/bundles/blog-common.js?v=lWYisON4NCZPE0cDhRSZfCJYBtCYvhrzIJwgrI08A5U1" type="text/javascript"></script>
</head>
<body>
<a name="top"></a>

<!--done-->
<div id="banner"><div id="bnr_pic">
<!--done-->
<div class="header">
	<div class="headerText">
		<a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/smcz/">科学家的博客</a><br>
	</div><br>
	<div class="headerDis"></div>
</div>
</div></div>
<div id="main">
	<!-- left starts -->
	<div id="left">
		<DIV id="mystats">
			<br/>
				
<!--done-->
<div class="blogStats">
随笔 - 7&nbsp;
文章 - 1&nbsp;
评论 - 4&nbsp;

</div>
			
		</DIV>
		<div id="mylinks">
<!--done-->
&nbsp;&nbsp;<a id="MyLinks1_MyHomeLink" class="menu" href="http://www.cnblogs.com/smcz/">首页</a>&nbsp;&nbsp;<a id="MyLinks1_NewPostLink" class="menu" rel="nofollow" href="http://i.cnblogs.com/EditPosts.aspx?opt=1">新随笔</a>&nbsp;&nbsp;<a id="MyLinks1_ContactLink" accesskey="9" class="menu" rel="nofollow" href="http://msg.cnblogs.com/send/%E7%A7%91%E5%AD%A6%E5%AE%B6">联系</a>&nbsp;&nbsp;<a id="MyLinks1_Admin" class="menu" rel="nofollow" href="http://i.cnblogs.com/">管理</a>&nbsp;&nbsp;<a id="MyLinks1_Syndication" class="menu" href="http://www.cnblogs.com/smcz/rss">订阅</a>&nbsp;<a id="MyLinks1_XMLLink" href="http://www.cnblogs.com/smcz/rss"><img src="http://www.cnblogs.com/images/xml.gif" alt="订阅" /></a></div>
		<div id="topics">
			
<div id="post_detail">
<div class="post">
	<div class="postTitle">
		<h1><a id="cb_post_title_url" class="postTitle2" href="http://www.cnblogs.com/smcz/archive/2008/07/18/1246032.html">用PHP扩展做一个HelloWorld！</a></h1>
	</div>
	<div id="cnblogs_post_body"><p><font face="Verdana">PHP 尽管提供了大量有用的函数，但是在特殊情况下还可能需要进行扩展编程，比如大量的 PECL（PHP Extension Community Library）就是以扩展的形式提供的(动态链接库dll文件)，它们比 PEAR 的运行效率要高很多。<br />
&nbsp;&nbsp;&nbsp; PHP 扩展是用 C 或 C++ 编写的，需要编译成动态连接库 dll 文件后在 PHP 环境下注册后才能使用。<br />
&nbsp;&nbsp;&nbsp; 编写 PHP 扩展的软件要求：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VC++6.0 或 VC++.NET 环境。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PHP 的源代码，需要编译。<br />
&nbsp;&nbsp;&nbsp; 如果不愿意编译 PHP 的源代码，可以再下载 PHP 的已经编译成功的二进制代码(就是我们部署 PHP 运行环境的那些文件包)。注意分别下载的源文件包和已编译包，它们的版本必须一致。</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 过程：</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 1，安装 VC++6.0，并选择把其可执行文件路径加入环境变量中，使在命令行环境任意路径下可以运行编译器。<br />
&nbsp;&nbsp;&nbsp; 2，安装 PHP 运行环境，并与 IIS 正确集成在一起。假设使用的 PHP 版本为 5.2.5，下载 php-5.2.5-Win32.zip 二进制包和 php-5.2.5.tar.gz 源代码包。安装环境为 C:\php-5.2.5-Win32。分别把源代码包和二进制包解压到该文件夹下。从 php.ini-recommended 拷贝生成一个 php.ini 文件。<br />
&nbsp;&nbsp;&nbsp; 3，建立 C:\php-5.2.5-Win32\Release_TS 文件夹，拷贝 C:\php-5.2.5-Win32\dev\php5ts.lib 文件到这里。<br />
&nbsp;&nbsp;&nbsp; 4，进入 C:\php-5.2.5-Win32\ext 文件夹，运行命令：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\php-5.2.5-Win32\ext&gt;..\php.exe ext_skel_win32.php --extname=myphpext<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Creating directory myphpext<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Creating basic files: config.m4 config.w32 .cvsignore myphpext.c php_myphpext.h<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CREDITS EXPERIMENTAL tests/001.phpt myphpext.php [done].</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; To use your new extension, you will have to execute the following steps:</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.&nbsp; $ cd ..<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.&nbsp; $ vi ext/myphpext/config.m4<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.&nbsp; $ ./buildconf<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4.&nbsp; $ ./configure --[with|enable]-myphpext<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5.&nbsp; $ make<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6.&nbsp; $ ./php -f ext/myphpext/myphpext.php<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7.&nbsp; $ vi ext/myphpext/myphpext.c<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8.&nbsp; $ make</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Repeat steps 3-6 until you are satisfied with ext/myphpext/config.m4 and<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; step 6 confirms that your module is compiled into PHP. Then, start writing<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; code and repeat the last two steps as often as necessary.</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 结果在 ext 下生成一个文件夹 myphpext，包含一个 PHP 扩展应用编程框架。myphpext 可以任意取名，将来生成的 dll 文件格式为 php_[extname].dll，我们生成的就是 php_myphpext.dll。运行结果的提示信息 1.2...8 主要是对 Linux/Unix 环境而言的，我们不必理会。其实 config.m4 文件在 Windows 下也可能需要修改，但是对于我们简单的框架暂时还用不着。</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 文件夹 myphpext 包含若干个文件，其中：</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; myphpext.dsp 是工程文件，后边还要用；<br />
&nbsp;&nbsp;&nbsp; myphpext.php 扩展测试文件；<br />
&nbsp;&nbsp;&nbsp; php_myphpext.h 扩展函数定义头文件<br />
&nbsp;&nbsp;&nbsp; myphpext.c 扩展函数具体实现</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 以上 2 个重要的文件内容：</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; php_myphpext.h 文件：<br />
</font></p>
<p><font face="Verdana"></p>
<div class="cnblogs_code"><img id="Codehighlighter1_0_1194_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_0_1194_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" /><span id="Codehighlighter1_0_1194_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_0_1194_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------------------------------------------+<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;PHP&nbsp;Version&nbsp;5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------------------------------------------+<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Copyright&nbsp;(c)&nbsp;1997-2007&nbsp;The&nbsp;PHP&nbsp;Group&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------------------------------------------+<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;This&nbsp;source&nbsp;file&nbsp;is&nbsp;subject&nbsp;to&nbsp;version&nbsp;3.01&nbsp;of&nbsp;the&nbsp;PHP&nbsp;license,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;that&nbsp;is&nbsp;bundled&nbsp;with&nbsp;this&nbsp;package&nbsp;in&nbsp;the&nbsp;file&nbsp;LICENSE,&nbsp;and&nbsp;is&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;available&nbsp;through&nbsp;the&nbsp;world-wide-web&nbsp;at&nbsp;the&nbsp;following&nbsp;url:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;</span><span style="color: #008000; text-decoration: underline">http://www.php.net/license/3_01.txt</span><span style="color: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;If&nbsp;you&nbsp;did&nbsp;not&nbsp;receive&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;PHP&nbsp;license&nbsp;and&nbsp;are&nbsp;unable&nbsp;to&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;obtain&nbsp;it&nbsp;through&nbsp;the&nbsp;world-wide-web,&nbsp;please&nbsp;send&nbsp;a&nbsp;note&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;license@php.net&nbsp;so&nbsp;we&nbsp;can&nbsp;mail&nbsp;you&nbsp;a&nbsp;copy&nbsp;immediately.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------------------------------------------+<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Author:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------------------------------------------+<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_1200_1264_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1200_1264_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1200_1264_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_1200_1264_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;$Id:&nbsp;header,v&nbsp;1.16.2.1.2.1&nbsp;2007/01/01&nbsp;19:32:09&nbsp;iliaa&nbsp;Exp&nbsp;$&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#ifndef&nbsp;PHP_MYPHPEXT_H<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#define</span><span style="color: #000000">&nbsp;PHP_MYPHPEXT_H</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">extern</span><span style="color: #000000">&nbsp;zend_module_entry&nbsp;myphpext_module_entry;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#define</span><span style="color: #000000">&nbsp;phpext_myphpext_ptr&nbsp;&amp;myphpext_module_entry</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#ifdef&nbsp;PHP_WIN32<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#define</span><span style="color: #000000">&nbsp;PHP_MYPHPEXT_API&nbsp;__declspec(dllexport)</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#else</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#define</span><span style="color: #000000">&nbsp;PHP_MYPHPEXT_API</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#ifdef&nbsp;ZTS<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#include&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">TSRM.h</span><span style="color: #800000">"</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_MINIT_FUNCTION(myphpext);<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_MSHUTDOWN_FUNCTION(myphpext);<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_RINIT_FUNCTION(myphpext);<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_RSHUTDOWN_FUNCTION(myphpext);<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_MINFO_FUNCTION(myphpext);<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_1825_1857_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1825_1857_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_FUNCTION(confirm_myphpext_compiled);&nbsp;</span><span id="Codehighlighter1_1825_1857_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_1825_1857_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;For&nbsp;testing,&nbsp;remove&nbsp;later.&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_FUNCTION(HelloPHP);<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_1891_2123_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1891_2123_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1891_2123_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_1891_2123_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Declare&nbsp;any&nbsp;global&nbsp;variables&nbsp;you&nbsp;may&nbsp;need&nbsp;between&nbsp;the&nbsp;BEGIN<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;END&nbsp;macros&nbsp;here:<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;ZEND_BEGIN_MODULE_GLOBALS(myphpext)<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;long&nbsp;&nbsp;global_value;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;*global_string;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;ZEND_END_MODULE_GLOBALS(myphpext)<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_2129_2680_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2129_2680_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_2129_2680_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_2129_2680_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;In&nbsp;every&nbsp;utility&nbsp;function&nbsp;you&nbsp;add&nbsp;that&nbsp;needs&nbsp;to&nbsp;use&nbsp;variables<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;php_myphpext_globals,&nbsp;call&nbsp;TSRMLS_FETCH();&nbsp;after&nbsp;declaring&nbsp;other<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;variables&nbsp;used&nbsp;by&nbsp;that&nbsp;function,&nbsp;or&nbsp;better&nbsp;yet,&nbsp;pass&nbsp;in&nbsp;TSRMLS_CC<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;after&nbsp;the&nbsp;last&nbsp;function&nbsp;argument&nbsp;and&nbsp;declare&nbsp;your&nbsp;utility&nbsp;function<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;TSRMLS_DC&nbsp;after&nbsp;the&nbsp;last&nbsp;declared&nbsp;argument.&nbsp;&nbsp;Always&nbsp;refer&nbsp;to<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;globals&nbsp;in&nbsp;your&nbsp;function&nbsp;as&nbsp;MYPHPEXT_G(variable).&nbsp;&nbsp;You&nbsp;are<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;encouraged&nbsp;to&nbsp;rename&nbsp;these&nbsp;macros&nbsp;something&nbsp;shorter,&nbsp;see<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;examples&nbsp;in&nbsp;any&nbsp;other&nbsp;php&nbsp;module&nbsp;directory.<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#ifdef&nbsp;ZTS<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#define</span><span style="color: #000000">&nbsp;MYPHPEXT_G(v)&nbsp;TSRMG(myphpext_globals_id,&nbsp;zend_myphpext_globals&nbsp;*,&nbsp;v)</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#else</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#define</span><span style="color: #000000">&nbsp;MYPHPEXT_G(v)&nbsp;(myphpext_globals.v)</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#endif</span><span style="color: #000000">&nbsp;/*&nbsp;PHP_MYPHPEXT_H&nbsp;*/</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_2884_3047_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2884_3047_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_2884_3047_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_2884_3047_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Local&nbsp;variables:<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;tab-width:&nbsp;4<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;c-basic-offset:&nbsp;4<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;End:<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;vim600:&nbsp;noet&nbsp;sw=4&nbsp;ts=4&nbsp;fdm=marker<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;vim&lt;600:&nbsp;noet&nbsp;sw=4&nbsp;ts=4<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /></span></div>
<p>&nbsp;&nbsp;</font><font face="Verdana">&nbsp; myphpext.c 文件：</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;</p>
<div class="cnblogs_code"><img id="Codehighlighter1_0_1194_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_0_1194_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" /><span id="Codehighlighter1_0_1194_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_0_1194_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------------------------------------------+<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;PHP&nbsp;Version&nbsp;5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------------------------------------------+<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Copyright&nbsp;(c)&nbsp;1997-2007&nbsp;The&nbsp;PHP&nbsp;Group&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------------------------------------------+<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;This&nbsp;source&nbsp;file&nbsp;is&nbsp;subject&nbsp;to&nbsp;version&nbsp;3.01&nbsp;of&nbsp;the&nbsp;PHP&nbsp;license,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;that&nbsp;is&nbsp;bundled&nbsp;with&nbsp;this&nbsp;package&nbsp;in&nbsp;the&nbsp;file&nbsp;LICENSE,&nbsp;and&nbsp;is&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;available&nbsp;through&nbsp;the&nbsp;world-wide-web&nbsp;at&nbsp;the&nbsp;following&nbsp;url:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;</span><span style="color: #008000; text-decoration: underline">http://www.php.net/license/3_01.txt</span><span style="color: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;If&nbsp;you&nbsp;did&nbsp;not&nbsp;receive&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;PHP&nbsp;license&nbsp;and&nbsp;are&nbsp;unable&nbsp;to&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;obtain&nbsp;it&nbsp;through&nbsp;the&nbsp;world-wide-web,&nbsp;please&nbsp;send&nbsp;a&nbsp;note&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;license@php.net&nbsp;so&nbsp;we&nbsp;can&nbsp;mail&nbsp;you&nbsp;a&nbsp;copy&nbsp;immediately.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------------------------------------------+<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Author:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----------------------------------------------------------------------+<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_1200_1264_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1200_1264_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1200_1264_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_1200_1264_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;$Id:&nbsp;header,v&nbsp;1.16.2.1.2.1&nbsp;2007/01/01&nbsp;19:32:09&nbsp;iliaa&nbsp;Exp&nbsp;$&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#ifdef&nbsp;HAVE_CONFIG_H<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#include&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">config.h</span><span style="color: #800000">"</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#include&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">php.h</span><span style="color: #800000">"</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#include&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">php_ini.h</span><span style="color: #800000">"</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#include&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">ext/standard/info.h</span><span style="color: #800000">"</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#include&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">php_myphpext.h</span><span style="color: #800000">"</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_1443_1555_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1443_1555_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1443_1555_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_1443_1555_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;If&nbsp;you&nbsp;declare&nbsp;any&nbsp;globals&nbsp;in&nbsp;php_myphpext.h&nbsp;uncomment&nbsp;this:<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;ZEND_DECLARE_MODULE_GLOBALS(myphpext)<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_1561_1621_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1561_1621_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1561_1621_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_1561_1621_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;True&nbsp;global&nbsp;resources&nbsp;-&nbsp;no&nbsp;need&nbsp;for&nbsp;thread&nbsp;safety&nbsp;here&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">static</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;le_myphpext;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_1655_1776_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1655_1776_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1655_1776_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_1655_1776_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;{{{&nbsp;myphpext_functions[]<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Every&nbsp;user&nbsp;visible&nbsp;function&nbsp;must&nbsp;have&nbsp;an&nbsp;entry&nbsp;in&nbsp;myphpext_functions[].<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_1824_2014_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1824_2014_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;zend_function_entry&nbsp;myphpext_functions[]&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span id="Codehighlighter1_1824_2014_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1824_2014_Open_Text"><span style="color: #000000">{<br />
<img id="Codehighlighter1_1872_1904_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1872_1904_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PHP_FE(confirm_myphpext_compiled,&nbsp;NULL)&nbsp;&nbsp;</span><span id="Codehighlighter1_1872_1904_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_1872_1904_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;For&nbsp;testing,&nbsp;remove&nbsp;later.&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PHP_FE(HelloPHP,&nbsp;NULL)<br />
<img id="Codehighlighter1_1938_1956_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1938_1956_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1938_1956_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1938_1956_Open_Text"><span style="color: #000000">{NULL,&nbsp;NULL,&nbsp;NULL}</span></span><span style="color: #000000">&nbsp;</span><span id="Codehighlighter1_1957_2008_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_1957_2008_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Must&nbsp;be&nbsp;the&nbsp;last&nbsp;line&nbsp;in&nbsp;myphpext_functions[]&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">;<br />
<img id="Codehighlighter1_2020_2029_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2020_2029_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_2020_2029_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_2020_2029_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;}}}&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_2035_2071_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2035_2071_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_2035_2071_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_2035_2071_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;{{{&nbsp;myphpext_module_entry<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_2118_2662_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2118_2662_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;zend_module_entry&nbsp;myphpext_module_entry&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span id="Codehighlighter1_2118_2662_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_2118_2662_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#if</span><span style="color: #000000">&nbsp;ZEND_MODULE_API_NO&nbsp;&gt;=&nbsp;20010901</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STANDARD_MODULE_HEADER,<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">myphpext</span><span style="color: #800000">"</span><span style="color: #000000">,<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myphpext_functions,<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PHP_MINIT(myphpext),<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PHP_MSHUTDOWN(myphpext),<br />
<img id="Codehighlighter1_2324_2389_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2324_2389_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PHP_RINIT(myphpext),&nbsp;&nbsp;</span><span id="Codehighlighter1_2324_2389_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_2324_2389_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Replace&nbsp;with&nbsp;NULL&nbsp;if&nbsp;there's&nbsp;nothing&nbsp;to&nbsp;do&nbsp;at&nbsp;request&nbsp;start&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_2420_2483_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2420_2483_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PHP_RSHUTDOWN(myphpext),&nbsp;</span><span id="Codehighlighter1_2420_2483_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_2420_2483_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Replace&nbsp;with&nbsp;NULL&nbsp;if&nbsp;there's&nbsp;nothing&nbsp;to&nbsp;do&nbsp;at&nbsp;request&nbsp;end&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PHP_MINFO(myphpext),<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#if</span><span style="color: #000000">&nbsp;ZEND_MODULE_API_NO&nbsp;&gt;=&nbsp;20010901</span><span style="color: #000000"><br />
<img id="Codehighlighter1_2561_2613_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2561_2613_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">0.1</span><span style="color: #800000">"</span><span style="color: #000000">,&nbsp;</span><span id="Codehighlighter1_2561_2613_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_2561_2613_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Replace&nbsp;with&nbsp;version&nbsp;number&nbsp;for&nbsp;your&nbsp;extension&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STANDARD_MODULE_PROPERTIES<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">;<br />
<img id="Codehighlighter1_2668_2677_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2668_2677_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_2668_2677_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_2668_2677_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;}}}&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;#ifdef&nbsp;COMPILE_DL_MYPHPEXT<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;ZEND_GET_MODULE(myphpext)<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">#endif</span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_2756_2778_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2756_2778_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_2756_2778_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_2756_2778_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;{{{&nbsp;PHP_INI<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_2783_3185_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_2783_3185_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_2783_3185_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_2783_3185_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Remove&nbsp;comments&nbsp;and&nbsp;fill&nbsp;if&nbsp;you&nbsp;need&nbsp;to&nbsp;have&nbsp;entries&nbsp;in&nbsp;php.ini<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_INI_BEGIN()<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STD_PHP_INI_ENTRY("myphpext.global_value",&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"42",&nbsp;PHP_INI_ALL,&nbsp;OnUpdateLong,&nbsp;global_value,&nbsp;zend_myphpext_globals,&nbsp;myphpext_globals)<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STD_PHP_INI_ENTRY("myphpext.global_string",&nbsp;"foobar",&nbsp;PHP_INI_ALL,&nbsp;OnUpdateString,&nbsp;global_string,&nbsp;zend_myphpext_globals,&nbsp;myphpext_globals)<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_INI_END()<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_3190_3199_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3190_3199_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3190_3199_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3190_3199_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;}}}&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_3205_3245_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3205_3245_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3205_3245_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3205_3245_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;{{{&nbsp;php_myphpext_init_globals<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_3250_3488_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3250_3488_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3250_3488_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3250_3488_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Uncomment&nbsp;this&nbsp;function&nbsp;if&nbsp;you&nbsp;have&nbsp;INI&nbsp;entries<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;static&nbsp;void&nbsp;php_myphpext_init_globals(zend_myphpext_globals&nbsp;*myphpext_globals)<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myphpext_globals-&gt;global_value&nbsp;=&nbsp;0;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myphpext_globals-&gt;global_string&nbsp;=&nbsp;NULL;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_3493_3502_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3493_3502_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3493_3502_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3493_3502_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;}}}&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_3508_3541_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3508_3541_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3508_3541_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3508_3541_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;{{{&nbsp;PHP_MINIT_FUNCTION<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_MINIT_FUNCTION(myphpext)<br />
<img id="Codehighlighter1_3579_3699_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3579_3699_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3579_3699_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_3579_3699_Open_Text"><span style="color: #000000">{<br />
<img id="Codehighlighter1_3586_3672_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3586_3672_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3586_3672_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3586_3672_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;If&nbsp;you&nbsp;have&nbsp;INI&nbsp;entries,&nbsp;uncomment&nbsp;these&nbsp;lines<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REGISTER_INI_ENTRIES();<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;SUCCESS;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_3704_3713_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3704_3713_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3704_3713_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3704_3713_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;}}}&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_3719_3756_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3719_3756_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3719_3756_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3719_3756_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;{{{&nbsp;PHP_MSHUTDOWN_FUNCTION<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_MSHUTDOWN_FUNCTION(myphpext)<br />
<img id="Codehighlighter1_3798_3917_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3798_3917_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3798_3917_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_3798_3917_Open_Text"><span style="color: #000000">{<br />
<img id="Codehighlighter1_3805_3890_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3805_3890_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3805_3890_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3805_3890_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;uncomment&nbsp;this&nbsp;line&nbsp;if&nbsp;you&nbsp;have&nbsp;INI&nbsp;entries<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UNREGISTER_INI_ENTRIES();<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;SUCCESS;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_3922_3931_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3922_3931_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3922_3931_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3922_3931_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;}}}&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_3937_3991_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3937_3991_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3937_3991_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3937_3991_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Remove&nbsp;if&nbsp;there's&nbsp;nothing&nbsp;to&nbsp;do&nbsp;at&nbsp;request&nbsp;start&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_3996_4029_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3996_4029_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_3996_4029_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_3996_4029_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;{{{&nbsp;PHP_RINIT_FUNCTION<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_RINIT_FUNCTION(myphpext)<br />
<img id="Codehighlighter1_4067_4095_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4067_4095_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4067_4095_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_4067_4095_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;SUCCESS;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_4100_4109_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4100_4109_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4100_4109_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_4100_4109_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;}}}&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_4115_4167_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4115_4167_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4115_4167_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_4115_4167_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Remove&nbsp;if&nbsp;there's&nbsp;nothing&nbsp;to&nbsp;do&nbsp;at&nbsp;request&nbsp;end&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_4172_4209_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4172_4209_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4172_4209_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_4172_4209_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;{{{&nbsp;PHP_RSHUTDOWN_FUNCTION<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_RSHUTDOWN_FUNCTION(myphpext)<br />
<img id="Codehighlighter1_4251_4279_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4251_4279_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4251_4279_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_4251_4279_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;SUCCESS;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_4284_4293_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4284_4293_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4284_4293_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_4284_4293_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;}}}&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_4299_4332_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4299_4332_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4299_4332_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_4299_4332_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;{{{&nbsp;PHP_MINFO_FUNCTION<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_MINFO_FUNCTION(myphpext)<br />
<img id="Codehighlighter1_4370_4605_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4370_4605_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4370_4605_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_4370_4605_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;php_info_print_table_start();<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;php_info_print_table_header(</span><span style="color: #800080">2</span><span style="color: #000000">,&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">myphpext&nbsp;support</span><span style="color: #800000">"</span><span style="color: #000000">,&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">enabled</span><span style="color: #800000">"</span><span style="color: #000000">);<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;php_info_print_table_end();<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_4514_4599_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4514_4599_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4514_4599_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_4514_4599_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Remove&nbsp;comments&nbsp;if&nbsp;you&nbsp;have&nbsp;entries&nbsp;in&nbsp;php.ini<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DISPLAY_INI_ENTRIES();<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_4610_4619_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4610_4619_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4610_4619_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_4610_4619_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;}}}&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_4625_4802_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4625_4802_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4625_4802_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_4625_4802_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Remove&nbsp;the&nbsp;following&nbsp;function&nbsp;when&nbsp;you&nbsp;have&nbsp;succesfully&nbsp;modified&nbsp;config.m4<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;so&nbsp;that&nbsp;your&nbsp;module&nbsp;can&nbsp;be&nbsp;compiled&nbsp;into&nbsp;PHP,&nbsp;it&nbsp;exists&nbsp;only&nbsp;for&nbsp;testing<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;purposes.&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_4808_4885_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4808_4885_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4808_4885_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_4808_4885_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;Every&nbsp;user-visible&nbsp;function&nbsp;in&nbsp;PHP&nbsp;should&nbsp;document&nbsp;itself&nbsp;in&nbsp;the&nbsp;source&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_4890_5015_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_4890_5015_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_4890_5015_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_4890_5015_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;{{{&nbsp;proto&nbsp;string&nbsp;confirm_myphpext_compiled(string&nbsp;arg)<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return&nbsp;a&nbsp;string&nbsp;to&nbsp;confirm&nbsp;that&nbsp;the&nbsp;module&nbsp;is&nbsp;compiled&nbsp;in&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_FUNCTION(confirm_myphpext_compiled)<br />
<img id="Codehighlighter1_5064_5444_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_5064_5444_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_5064_5444_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_5064_5444_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">char</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">arg&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;NULL;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;arg_len,&nbsp;len;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">char</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">strg;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_5221_5243_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_5221_5243_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(zend_parse_parameters(ZEND_NUM_ARGS()&nbsp;TSRMLS_CC,&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">s</span><span style="color: #800000">"</span><span style="color: #000000">,&nbsp;</span><span style="color: #000000">&amp;</span><span style="color: #000000">arg,&nbsp;</span><span style="color: #000000">&amp;</span><span style="color: #000000">arg_len)&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;FAILURE)&nbsp;</span><span id="Codehighlighter1_5221_5243_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_5221_5243_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;len&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;spprintf(</span><span style="color: #000000">&amp;</span><span style="color: #000000">strg,&nbsp;</span><span style="color: #800080">0</span><span style="color: #000000">,&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">Congratulations!&nbsp;You&nbsp;have&nbsp;successfully&nbsp;modified&nbsp;ext/%.78s/config.m4.&nbsp;Module&nbsp;%.78s&nbsp;is&nbsp;now&nbsp;compiled&nbsp;into&nbsp;PHP.</span><span style="color: #800000">"</span><span style="color: #000000">,&nbsp;</span><span style="color: #800000">"</span><span style="color: #800000">myphpext</span><span style="color: #800000">"</span><span style="color: #000000">,&nbsp;arg);<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETURN_STRINGL(strg,&nbsp;len,&nbsp;</span><span style="color: #800080">0</span><span style="color: #000000">);<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;PHP_FUNCTION(HelloPHP)<br />
<img id="Codehighlighter1_5477_5534_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_5477_5534_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_5477_5534_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_5477_5534_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;php_printf(</span><span style="color: #800000">"</span><span style="color: #800000">Hello,&nbsp;PHP&nbsp;v5.2.5&nbsp;-&nbsp;2008-3-28</span><span style="color: #800000">"</span><span style="color: #000000">);<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_5540_5549_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_5540_5549_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_5540_5549_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_5540_5549_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;}}}&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_5554_5880_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_5554_5880_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_5554_5880_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_5554_5880_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">&nbsp;The&nbsp;previous&nbsp;line&nbsp;is&nbsp;meant&nbsp;for&nbsp;vim&nbsp;and&nbsp;emacs,&nbsp;so&nbsp;it&nbsp;can&nbsp;correctly&nbsp;fold&nbsp;and<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unfold&nbsp;functions&nbsp;in&nbsp;source&nbsp;code.&nbsp;See&nbsp;the&nbsp;corresponding&nbsp;marks&nbsp;just&nbsp;before<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;definition,&nbsp;where&nbsp;the&nbsp;functions&nbsp;purpose&nbsp;is&nbsp;also&nbsp;documented.&nbsp;Please<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;follow&nbsp;this&nbsp;convention&nbsp;for&nbsp;the&nbsp;convenience&nbsp;of&nbsp;others&nbsp;editing&nbsp;your&nbsp;code.<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img id="Codehighlighter1_5886_6049_Open_Image" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_5886_6049_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_5886_6049_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_5886_6049_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Local&nbsp;variables:<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;tab-width:&nbsp;4<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;c-basic-offset:&nbsp;4<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;End:<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;vim600:&nbsp;noet&nbsp;sw=4&nbsp;ts=4&nbsp;fdm=marker<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;vim&lt;600:&nbsp;noet&nbsp;sw=4&nbsp;ts=4<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /></span></div>
<p></font><font face="Verdana">&nbsp;&nbsp;&nbsp; 注意本例定义了一个函数 HelloPHP。在 php_myphpext.h 文件中定义：<br />
&nbsp;&nbsp;&nbsp; PHP_FUNCTION(HelloPHP);</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 在 myphpext.c 中有 2 处地方：</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; PHP_FE(HelloPHP, NULL) 语句把我们自己的函数加入入口数组中。</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 以下定义了 HelloPHP 函数的内容:<br />
&nbsp;&nbsp;&nbsp; PHP_FUNCTION(HelloPHP)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp; php_printf("Hello, PHP v5.2.5 - 2008-3-28");<br />
&nbsp;&nbsp;&nbsp; }</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 其实还有个 confirm_myphpext_compiled 函数，是自动产生的，用于测试，与我们的自定义函数用法一模一样。</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 5，编译、链接，生成最终的文件。</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; C:\php-5.2.5-Win32\ext&gt;msdev myphpext\myphpext.dsp /MAKE "myphpext - Win32 Release_TS"<br />
&nbsp;&nbsp;&nbsp; -----------Configuration: myphpext - Win32 Release_TS-----------<br />
&nbsp;&nbsp;&nbsp; Compiling...<br />
&nbsp;&nbsp;&nbsp; myphpext.c<br />
&nbsp;&nbsp;&nbsp; Linking...<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Creating library Release_TS/php_myphpext.lib and object Release_TS/php_myphpext.exp</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; php_myphpext.dll - 0 error(s), 0 warning(s)</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 最终在 C:\php-5.2.5-Win32\Release_TS 下生成了扩展库 php_myphpext.dll。</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 6，部署：</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp; 把 php_myphpext.dll 拷贝到 C:\php-5.2.5-Win32\ext 文件夹下。修改 php.ini 文件：</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp; 加语句 extension=php_myphpext.dll。</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp; 再注意 extension 路径的指向，需要把 ;extension_dir = "./" 语句的注释去掉，再修改为 extension_dir = "C:\php-5.2.5-Win32\ext"。</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp; 最后一定要重启 IIS 服务器。</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 7，测试：</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 把 myphpext.php 拷贝到 Web 服务器根下（myphpext.php 的代码也值得一看），在本机用浏览器打开：http://localhost/myphpext.php，应该能看到以下信息：</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; Functions available in the test extension:<br />
&nbsp;&nbsp;&nbsp; confirm_myphpext_compiled<br />
&nbsp;&nbsp;&nbsp; HelloPHP</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; Congratulations! You have successfully modified ext/myphpext/config.m4. Module myphpext is now compiled into PHP.</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 再建立一个 test.php 文件，内容为：</font></p>
<p><font face="Verdana">&nbsp;</p>
<div class="cnblogs_code"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;?</span><span style="color: #000000">php<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HelloPHP();<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">?&gt;</span></div>
<p></font>&nbsp;</p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 用本机浏览器打开：http://localhost/test.php，应该能看到以下信息：</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; Hello, PHP v5.2.5 - 2008-3-28</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp; 这说明我们所有的步骤都是正确的，已经生成了一个自己的 PHP 扩展函数库。只要对 C 语言熟悉，就可以编写大量的自定义函数，供所有人调用。注意，不像 PEAR 等函数库，需要首先在 PHP 代码里指定其文件名才能使用其中的函数和类。PHP 扩展的函数不是用 PHP 语言自身开发的，而是 C 开发的，而且可以直接在 PHP 代码里调用。这样既有一定的保密性，还有效率上的优势。<br />
&nbsp;&nbsp;&nbsp; 开发 PHP 扩展的更多示例可以参考 PHP 的源代码，或者其它的 PECL 源代码。从那里可以学习到大量的技巧。</font></p>
  </div><div id="MySignature"></div>
<div class="clear"></div>
<div id="blog_post_info_block">
<div id="BlogPostCategory"></div>
<div id="EntryTag"></div>
<div id="blog_post_info">
</div>
<div class="clear"></div>
<div id="post_next_prev"></div>
</div>


	<div class="postDesc">posted on <span id="post-date">2008-07-18 14:02</span> <a href='http://www.cnblogs.com/smcz/'>科学家</a> 阅读(<span id="post_view_count">...</span>) 评论(<span id="post_comment_count">...</span>)  <a href ="http://i.cnblogs.com/EditPosts.aspx?postid=1246032" rel="nofollow">编辑</a> <a href="#" onclick="AddToWz(1246032);return false;">收藏</a></div>
</div>
<script type="text/javascript">var allowComments=true,isLogined=false,cb_blogId=40443,cb_entryId=1246032,cb_blogApp=currentBlogApp,cb_blogUserGuid='5247420b-63cf-dd11-9e4d-001cf0cd104b',cb_entryCreatedDate='2008/7/18 14:02:00';loadViewCount(cb_entryId);</script>

</div><a name="!comments"></a><div id="blog-comments-placeholder"></div><script type="text/javascript">var commentManager = new blogCommentManager();commentManager.renderComments(0);</script>
<div id="comment_form" class="commentform">
<a name="commentform"></a>
<div id="divCommentShow"></div>
<div id="comment_nav"><span id="span_refresh_tips"></span><a href="javascript:void(0);" id="lnk_RefreshComments" onclick="return RefreshCommentList();">刷新评论</a><a href="#" onclick="return RefreshPage();">刷新页面</a><a href="#top">返回顶部</a></div>
<div id="comment_form_container"></div>
<div class="ad_text_commentbox" id="ad_text_under_commentbox"></div>
<div id="site_nav_under"><a href="http://www.cnblogs.com/" target="_blank" title="开发者的网上家园">博客园首页</a><a href="http://q.cnblogs.com/" target="_blank" title="程序员问答社区">博问</a><a href="http://news.cnblogs.com/" target="_blank" title="IT新闻">新闻</a><a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a><a href="http://job.cnblogs.com/" target="_blank">程序员招聘</a><a href="http://kb.cnblogs.com/" target="_blank">知识库</a></div>
<div id="opt_under_post"></div>
<script type="text/javascript">
    var enableGoogleAd = canShowAdsense(); 
    fixPostBodyFormat();
</script>
<script type='text/javascript'>
  var googletag = googletag || {};
  googletag.cmd = googletag.cmd || [];
    (function () {
        if (enableGoogleAd) {
            var gads = document.createElement('script');
            gads.async = true;
            gads.type = 'text/javascript';
            var useSSL = 'https:' == document.location.protocol;
            gads.src = (useSSL ? 'https:' : 'http:') +
              '//www.googletagservices.com/tag/js/gpt.js';
            var node = document.getElementsByTagName('script')[0];
            node.parentNode.insertBefore(gads, node);
        }
  })();
</script>
<script type='text/javascript'>
    try {
        if (enableGoogleAd) {
            googletag.cmd.push(function() {
            googletag.defineSlot('/1090369/cnblogs_blogpost_C2', [468, 60], 'div-gpt-ad-1433581717989-0').addService(googletag.pubads());
            googletag.defineSlot('/1090369/cnblogs_blogpost_C1_sitehome', [300, 250], 'div-gpt-ad-1433581717989-1').addService(googletag.pubads());
            googletag.pubads().enableSingleRequest();
            googletag.pubads().collapseEmptyDivs();
            googletag.enableServices();
            });
        };
    } catch (e) { }
</script>
<div id="google_ad_c1" class="c_ad_block">
    <div id='div-gpt-ad-1433581717989-1' style='height:250px; width:300px;'>
    <script type='text/javascript'>
        try {
            if (enableGoogleAd) {
                googletag.cmd.push(function () { googletag.display('div-gpt-ad-1433581717989-1'); });
            } else {
                $('#div-gpt-ad-1433581717989-1').hide();
            }
    } catch (e) { }
    </script>
    </div>
</div>
<div id="under_post_news"></div>
<div id="google_ad_c2" class="c_ad_block">
<div id='div-gpt-ad-1433581717989-0' style='height:60px; width:468px;'>
<script type='text/javascript'>
try {
    if (enableGoogleAd) {
        googletag.cmd.push(function () { googletag.display('div-gpt-ad-1433581717989-0'); });
    } else {
        $('#div-gpt-ad-1433581717989-0').hide();
    }
} catch (e) { }
</script>
</div>
</div>
<div id="under_post_kb"></div>
<div id="HistoryToday" class="c_ad_block"></div>
<script type="text/javascript">
$(function () {
    loadNewsAndKb();
    loadBlogSignature();
    LoadPostInfoBlock(cb_blogId, cb_entryId, cb_blogApp, cb_blogUserGuid);
    GetPrevNextPost(cb_entryId, cb_blogId, cb_entryCreatedDate);
    loadOptUnderPost();
    GetHistoryToday(cb_blogId, cb_blogApp, cb_entryCreatedDate);
    setTimeout(function () { incrementViewCount(cb_entryId); }, 200);
});
</script>
</div>

		</div>
	</div>
	<!-- left ends -->
	<!-- right starts -->
	<div id="right">
		<!-- 右侧工具部分 -->
		<div id="right_content">
	
			
<!--done-->
<h2 class="listtitle">公告</h2>
<div class="newsItem">
	<div id="blog-news"></div><script type="text/javascript">loadBlogNews();</script>
</div>

	
			<div id="calendar"><div id="blog-calendar" style="display:none"></div><script type="text/javascript">loadBlogDefaultCalendar();</script></div>
			
				<DIV id="leftcontentcontainer">
					<div id="blog-sidecolumn"></div><script type="text/javascript">loadBlogSideColumn();</script>
				</DIV>
			
		</div>
		<!-- //右侧工具部分 -->
		<div id="footer">
			
<!--done-->
Copyright &copy;2015 科学家
		</div>
	</div>
	<!-- right ends -->
	<div class="clear"></div>
	
</div>

<!--PageEndHtml Block Begin-->
<div align=center><SPAN style=DISPLAY 

<!--PageEndHtml Block End-->
</body>
</html>
